Dynomotion

Group: DynoMotion Message: 15021 From: Hardy Family Date: 9/19/2017
Subject: Correctly unwinding rotary axis
We use the following code to "unwind" the B axis (i.e. instantly remove multiples of 360 degrees without physically moving the axis):

void unwind_b(void)
{
    double p, k;
    int n;

    p = chan[4].Dest;
    n = (int)(p / 360);
    k = -n*360.;
    while (p+k < -180)
        k += 360.;
    while (p+k >= 180)
        k -= 360.;
   
    WaitNextTimeSlice();    // Avoid interrupts
    chan[4].Dest += k;
    chan[4].Position += k;
}

Unfortunately, we are getting permanent lost motion in some cases.  I suspect we should be adding a call to ResetFilters() in there, to avoid a sudden impulse.  But I am not sure when/where to do this.  Should it be after the Position increment?  Or maybe it is something else?

Regards,
SJH

Group: DynoMotion Message: 15022 From: Tom Kerekes Date: 9/20/2017
Subject: Re: Correctly unwinding rotary axis
Attachments :
    Hi SJH,

    I can't see how that would cause a loss of Position.  Possibly a spike in the output.  Is this Step/Dir mode?

    But this may work better.   See attached.

    Regards
    TK


    On 9/19/2017 10:50 PM, Hardy Family hardy.woodland.cypress@... [DynoMotion] wrote:
     
    We use the following code to "unwind" the B axis (i.e. instantly remove multiples of 360 degrees without physically moving the axis):

    void unwind_b(void)
    {
        double p, k;
        int n;

        p = chan[4].Dest;
        n = (int)(p / 360);
        k = -n*360.;
        while (p+k < -180)
            k += 360.;
        while (p+k >= 180)
            k -= 360.;
       
        WaitNextTimeSlice();    // Avoid interrupts
        chan[4].Dest += k;
        chan[4].Position += k;
    }

    Unfortunately, we are getting permanent lost motion in some cases.  I suspect we should be adding a call to ResetFilters() in there, to avoid a sudden impulse.  But I am not sure when/where to do this.  Should it be after the Position increment?  Or maybe it is something else?

    Regards,
    SJH


    Group: DynoMotion Message: 15039 From: Hardy Family Date: 9/23/2017
    Subject: Re: Correctly unwinding rotary axis
    Hi Tom,

    Thanks for that; yes it works much better.  The key seems to be disabling and re-enabling the axis with the 'dest' option.

    So now our customer is very grateful not to have to wait 10 minutes while the table unwinds itself.

    Regards,
    SJH


    On Wed, Sep 20, 2017 at 6:38 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
     

    Hi SJH,

    I can't see how that would cause a loss of Position.  Possibly a spike in the output.  Is this Step/Dir mode?

    But this may work better.   See attached.

    Regards
    TK




    On 9/19/2017 10:50 PM, Hardy Family hardy.woodland.cypress@gmail. com [DynoMotion] wrote:
     
    We use the following code to "unwind" the B axis (i.e. instantly remove multiples of 360 degrees without physically moving the axis):

    void unwind_b(void)
    {
        double p, k;
        int n;

        p = chan[4].Dest;
        n = (int)(p / 360);
        k = -n*360.;
        while (p+k < -180)
            k += 360.;
        while (p+k >= 180)
            k -= 360.;
       
        WaitNextTimeSlice();    // Avoid interrupts
        chan[4].Dest += k;
        chan[4].Position += k;
    }

    Unfortunately, we are getting permanent lost motion in some cases.  I suspect we should be adding a call to ResetFilters() in there, to avoid a sudden impulse.  But I am not sure when/where to do this.  Should it be after the Position increment?  Or maybe it is something else?

    Regards,
    SJH